class CPU {
    private int speed;

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getSpeed() {
        return speed;
    }
}
class HardDisk {
    private int amount;

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public int getAmount() {
        return amount;
    }
}
class PC {
    private CPU cpu;
    private HardDisk hd;

    public void setCPU(CPU cpu) {
        this.cpu = cpu;
    }

    public void setHardDisk(HardDisk hd) {
        this.hd = hd;
    }

    public void show() {
        System.out.println("CPU速度：" + cpu.getSpeed());
        System.out.println("硬盘容量：" + hd.getAmount());
    }
}
class Test {
    public static void main(String[] args) {
        // 创建一个CPU对象cpu
        CPU cpu = new CPU();
        // cpu将自己的speed设置为2200
        cpu.setSpeed(2200);

        // 创建一个HardDisk对象disk
        HardDisk disk = new HardDisk();
        // disk将自己的amount设置为200
        disk.setAmount(200);

        // 创建一个PC对象pc
        PC pc = new PC();
        // pc调用setCPU(CPU c)方法，实参为cpu
        pc.setCPU(cpu);
        // pc调用setHardDisk(HardDisk h)方法，实参为disk
        pc.setHardDisk(disk);
        // pc调用show()方法
        pc.show();
    }
}